package o;

import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.os.Parcelable;
import com.huawei.appgallery.packagemanager.api.bean.ManagerTask;
import com.huawei.appgallery.packagemanager.impl.uninstall.control.UninstallResultReceiver;
import com.huawei.hwid.core.constants.HwAccountConstants;

public class cpx {
    public static void ˏ(Context context, ManagerTask managerTask) {
        Intent intent = new Intent(context, UninstallResultReceiver.class);
        intent.putExtra("package_task_result_receiver_packagename", managerTask.packageName);
        intent.putExtra("package_task_result_receiver_taskid", managerTask.taskId);
        intent.setPackage(context.getPackageName());
        Parcelable broadcast = PendingIntent.getBroadcast(context, managerTask.packageName.hashCode(), intent, HwAccountConstants.FLAG_TRANS_NAVIGATION_BAR);
        Intent intent2 = new Intent("com.android.packageinstaller.intent.action.DELETE_PACKAGES_SILENT");
        intent2.putExtra("com.android.packageinstaller.extra.EXTRA_REQUEST_UNINSTALL_PKGS", new String[]{managerTask.packageName});
        intent2.putExtra("android.intent.extra.UNINSTALL_ALL_USERS", managerTask.uninstallForAllUser);
        intent2.putExtra("com.android.packageinstaller.extra.EXTRA_REQUEST_UNINSTALL_PENDINGTENT", broadcast);
        intent2.setPackage("com.android.packageinstaller");
        context.sendBroadcast(intent2, "com.android.packageinstaller.permission.REQUEST_DELETE_PACKAGES");
        Handler ˋ = cpf.ˋ(context.getApplicationContext());
        Message obtain = Message.obtain(ˋ, new cpv(context, managerTask.packageName));
        obtain.what = managerTask.packageName.hashCode() + 20170710;
        ˋ.sendMessageDelayed(obtain, 10000);
    }
}
